import { defineStore } from 'pinia'

export const apiData = defineStore('apiData', {
  state: () => ({
    info: [],
  }),
  getters: {
    getInfo() {
      return this.info
    },
    getInfoByKey(state) {
      return (key) => {
        return state.info[key]
      }
    },
  },
  actions: {
    setInfo(info) {
      this.info = {...info}
    },
  },
})
